// 换算单位， 超过10000换算成万
const numberFormat = (value: any) => {
	let param = {
		value: 0,
		unit: ''
	}
	let k = 10000,
		sizes = ['', '万', '亿', '万亿'],
		i;
	if (value < k) {
		param.value = value
		param.unit = ''
	} else {
		i = Math.floor(Math.log(value) / Math.log(k));

		param.value = parseFloat(((value / Math.pow(k, i))).toFixed(2));
		// param.value = value / Math.pow(k, i);
		param.unit = sizes[i];
	}
	return param
}

export default numberFormat